
_main:

;tric.c,31 :: 		void main() {
;tric.c,43 :: 		ADCON1 = 0x0F;    // Set A/D Disabled
	MOVLW       15
	MOVWF       ADCON1+0 
;tric.c,46 :: 		CMCON  = 0xCF;    // Set Comparator Disabled
	MOVLW       207
	MOVWF       CMCON+0 
;tric.c,49 :: 		TRISA = 0b00000001;
	MOVLW       1
	MOVWF       TRISA+0 
;tric.c,50 :: 		TRISB = 0b00000100;
	MOVLW       4
	MOVWF       TRISB+0 
;tric.c,51 :: 		TRISC = 0b00000000;
	CLRF        TRISC+0 
;tric.c,54 :: 		LED_STATUS1 = 1;
	BSF         PORTC+0, 2 
;tric.c,55 :: 		LED_STATUS2 = 0;
	BCF         PORTB+0, 5 
;tric.c,56 :: 		LED_STATUS3 = 0;
	BCF         PORTB+0, 3 
;tric.c,57 :: 		LED_AUX = 0;
	BCF         PORTB+0, 6 
;tric.c,58 :: 		FPV_ENABLE = 0;
	BCF         PORTA+0, 5 
;tric.c,59 :: 		BEEPER = 0;
	BCF         PORTA+0, 4 
;tric.c,60 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;tric.c,61 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;tric.c,62 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;tric.c,63 :: 		MOTORS_MS = 1;
	BSF         PORTC+0, 7 
;tric.c,64 :: 		Delay_ms(1000);
	MOVLW       61
	MOVWF       R11, 0
	MOVLW       225
	MOVWF       R12, 0
	MOVLW       63
	MOVWF       R13, 0
L_main0:
	DECFSZ      R13, 1, 1
	BRA         L_main0
	DECFSZ      R12, 1, 1
	BRA         L_main0
	DECFSZ      R11, 1, 1
	BRA         L_main0
	NOP
	NOP
;tric.c,71 :: 		SENSORS_init();
	CALL        _SENSORS_init+0, 0
;tric.c,72 :: 		MOTORS_M1 = 1;
	BSF         PORTC+0, 0 
;tric.c,73 :: 		MOTORS_M2 = 1;
	BSF         PORTC+0, 1 
;tric.c,74 :: 		MOTORS_M3 = 1;
	BSF         PORTC+0, 6 
;tric.c,75 :: 		MOTORS_MS = 1;
	BSF         PORTC+0, 7 
;tric.c,76 :: 		Delay_ms(1000);
	MOVLW       61
	MOVWF       R11, 0
	MOVLW       225
	MOVWF       R12, 0
	MOVLW       63
	MOVWF       R13, 0
L_main1:
	DECFSZ      R13, 1, 1
	BRA         L_main1
	DECFSZ      R12, 1, 1
	BRA         L_main1
	DECFSZ      R11, 1, 1
	BRA         L_main1
	NOP
	NOP
;tric.c,77 :: 		LED_STATUS1 = 0;
	BCF         PORTC+0, 2 
;tric.c,78 :: 		LED_STATUS2 = 1;
	BSF         PORTB+0, 5 
;tric.c,82 :: 		T0CON.T0PS0 = 0;     // Prescaler 1:64
	BCF         T0CON+0, 0 
;tric.c,83 :: 		T0CON.T0PS1 = 1;     // Prescaler 1:64
	BSF         T0CON+0, 1 
;tric.c,84 :: 		T0CON.T0PS2 = 1;     // Prescaler 1:64
	BSF         T0CON+0, 2 
;tric.c,85 :: 		T0CON.PSA = 1;       // Timer Clock Source is from Prescaler
	BSF         T0CON+0, 3 
;tric.c,86 :: 		T0CON.T0CS = 0;      // Prescaler gets clock from FCPU
	BCF         T0CON+0, 5 
;tric.c,87 :: 		T0CON.T08BIT = 0;    // Disable 8 BIT MODE
	BCF         T0CON+0, 6 
;tric.c,88 :: 		TMR0L = 0;           // TMR0 preset
	CLRF        TMR0L+0 
;tric.c,89 :: 		TMR0H = 0;           // TMR0 preset
	CLRF        TMR0H+0 
;tric.c,90 :: 		T0CON.TMR0ON = 0;    // Timer0 start/stop
	BCF         T0CON+0, 7 
;tric.c,94 :: 		T1CON.T1CKPS1 = 0;        // Prescaler 1:0
	BCF         T1CON+0, 5 
;tric.c,95 :: 		T1CON.T1CKPS0 = 0;        // Prescaler 1:0   --> 0,33uS per tick
	BCF         T1CON+0, 4 
;tric.c,96 :: 		TMR1H = 0xD1;             // High byte timer
	MOVLW       209
	MOVWF       TMR1H+0 
;tric.c,97 :: 		TMR1L = 0x80;             // Low  byte timer
	MOVLW       128
	MOVWF       TMR1L+0 
;tric.c,98 :: 		PIR1.TMR1IF = 0 ;         // Clear timer 1 interrupt flag
	BCF         PIR1+0, 0 
;tric.c,99 :: 		T1CON.TMR1ON = 0;         // Timer1 start/stop
	BCF         T1CON+0, 0 
;tric.c,103 :: 		INTCON.GIE = 1 ;         // Enable global interrupts
	BSF         INTCON+0, 7 
;tric.c,104 :: 		INTCON.PEIE = 1 ;        // Enable Peripheral Interrupt
	BSF         INTCON+0, 6 
;tric.c,105 :: 		PIE1.TMR1IE = 1  ;       // Enable Timer1 Interrupt
	BSF         PIE1+0, 0 
;tric.c,106 :: 		PIR1.TMR1IF = 0 ;        // Clear Timer1 Interrupt flag
	BCF         PIR1+0, 0 
;tric.c,107 :: 		INTCON.TMR0IE = 0;       // Enable Timer0 Interrupt
	BCF         INTCON+0, 5 
;tric.c,108 :: 		INTCON.TMR0IF = 0;       // Clear Timer0 Interrupt flag
	BCF         INTCON+0, 2 
;tric.c,109 :: 		INTCON2.INTEDG2 = 1;     // Set INT2 on rising edge
	BSF         INTCON2+0, 4 
;tric.c,110 :: 		INTCON3.INT2IE = 1;      // Enable INT2 Interrupt
	BSF         INTCON3+0, 4 
;tric.c,111 :: 		INTCON3.INT2IF = 0;      // Clear INT2 Interrupt flag
	BCF         INTCON3+0, 1 
;tric.c,115 :: 		THREAD_counts = 0;
	CLRF        _THREAD_counts+0 
;tric.c,116 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,117 :: 		RX_counts=0;
	CLRF        _RX_counts+0 
;tric.c,118 :: 		THREAD_emergencyLanding = 0;
	CLRF        _THREAD_emergencyLanding+0 
;tric.c,119 :: 		MOTORS_speed[0] = 55;
	MOVLW       55
	MOVWF       _MOTORS_speed+0 
;tric.c,120 :: 		MOTORS_speed[1] = 55;
	MOVLW       55
	MOVWF       _MOTORS_speed+1 
;tric.c,121 :: 		MOTORS_speed[2] = 55;
	MOVLW       55
	MOVWF       _MOTORS_speed+2 
;tric.c,122 :: 		MOTORS_speed[3] = 55;
	MOVLW       55
	MOVWF       _MOTORS_speed+3 
;tric.c,128 :: 		MOTORS_esc_startup();
	CALL        _MOTORS_esc_startup+0, 0
;tric.c,129 :: 		LED_STATUS2 = 0;
	BCF         PORTB+0, 5 
;tric.c,130 :: 		T1CON.TMR1ON = 1;
	BSF         T1CON+0, 0 
;tric.c,145 :: 		while (1) {
L_main2:
;tric.c,146 :: 		if(THREAD_ready){
	MOVF        _THREAD_ready+0, 1 
	BTFSC       STATUS+0, 2 
	GOTO        L_main4
;tric.c,147 :: 		switch(THREAD_counts){
	GOTO        L_main5
;tric.c,148 :: 		case 1:
L_main7:
;tric.c,149 :: 		LED_STATUS1 = !LED_STATUS1;
	BTG         PORTC+0, 2 
;tric.c,150 :: 		break;
	GOTO        L_main6
;tric.c,152 :: 		case 11:
L_main8:
;tric.c,154 :: 		break;
	GOTO        L_main6
;tric.c,155 :: 		case 13:
L_main9:
;tric.c,157 :: 		break;
	GOTO        L_main6
;tric.c,159 :: 		case 20:
L_main10:
;tric.c,161 :: 		MOTORS_M1 = 0;
	BCF         PORTC+0, 0 
;tric.c,162 :: 		MOTORS_M2 = 0;
	BCF         PORTC+0, 1 
;tric.c,163 :: 		MOTORS_M3 = 0;
	BCF         PORTC+0, 6 
;tric.c,164 :: 		MOTORS_MS = 0;
	BCF         PORTC+0, 7 
;tric.c,168 :: 		case 0:
L_main11:
;tric.c,179 :: 		case 2:
L_main12:
;tric.c,184 :: 		case 4:
L_main13:
;tric.c,189 :: 		case 6:
L_main14:
;tric.c,194 :: 		case 8:
L_main15:
;tric.c,199 :: 		case 10:
L_main16:
;tric.c,204 :: 		case 12:
L_main17:
;tric.c,209 :: 		case 14:
L_main18:
;tric.c,214 :: 		case 16:
L_main19:
;tric.c,215 :: 		case 18:
L_main20:
;tric.c,221 :: 		RX_applyThrottleToMotors(&RX_values, &MOTORS_speed);
	MOVLW       _RX_values+0
	MOVWF       FARG_RX_applyThrottleToMotors_RX_angle+0 
	MOVLW       hi_addr(_RX_values+0)
	MOVWF       FARG_RX_applyThrottleToMotors_RX_angle+1 
	MOVLW       _MOTORS_speed+0
	MOVWF       FARG_RX_applyThrottleToMotors_MOTORS_speed+0 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FARG_RX_applyThrottleToMotors_MOTORS_speed+1 
	CALL        _RX_applyThrottleToMotors+0, 0
;tric.c,222 :: 		break;
	GOTO        L_main6
;tric.c,224 :: 		case 21:
L_main21:
;tric.c,225 :: 		MOTORS_update(&MOTORS_speed);
	MOVLW       _MOTORS_speed+0
	MOVWF       FARG_MOTORS_update_MOTORS_speed+0 
	MOVLW       hi_addr(_MOTORS_speed+0)
	MOVWF       FARG_MOTORS_update_MOTORS_speed+1 
	CALL        _MOTORS_update+0, 0
;tric.c,226 :: 		THREAD_counts = 0;
	CLRF        _THREAD_counts+0 
;tric.c,227 :: 		break;
	GOTO        L_main6
;tric.c,228 :: 		}
L_main5:
	MOVF        _THREAD_counts+0, 0 
	XORLW       1
	BTFSC       STATUS+0, 2 
	GOTO        L_main7
	MOVF        _THREAD_counts+0, 0 
	XORLW       11
	BTFSC       STATUS+0, 2 
	GOTO        L_main8
	MOVF        _THREAD_counts+0, 0 
	XORLW       13
	BTFSC       STATUS+0, 2 
	GOTO        L_main9
	MOVF        _THREAD_counts+0, 0 
	XORLW       20
	BTFSC       STATUS+0, 2 
	GOTO        L_main10
	MOVF        _THREAD_counts+0, 0 
	XORLW       0
	BTFSC       STATUS+0, 2 
	GOTO        L_main11
	MOVF        _THREAD_counts+0, 0 
	XORLW       2
	BTFSC       STATUS+0, 2 
	GOTO        L_main12
	MOVF        _THREAD_counts+0, 0 
	XORLW       4
	BTFSC       STATUS+0, 2 
	GOTO        L_main13
	MOVF        _THREAD_counts+0, 0 
	XORLW       6
	BTFSC       STATUS+0, 2 
	GOTO        L_main14
	MOVF        _THREAD_counts+0, 0 
	XORLW       8
	BTFSC       STATUS+0, 2 
	GOTO        L_main15
	MOVF        _THREAD_counts+0, 0 
	XORLW       10
	BTFSC       STATUS+0, 2 
	GOTO        L_main16
	MOVF        _THREAD_counts+0, 0 
	XORLW       12
	BTFSC       STATUS+0, 2 
	GOTO        L_main17
	MOVF        _THREAD_counts+0, 0 
	XORLW       14
	BTFSC       STATUS+0, 2 
	GOTO        L_main18
	MOVF        _THREAD_counts+0, 0 
	XORLW       16
	BTFSC       STATUS+0, 2 
	GOTO        L_main19
	MOVF        _THREAD_counts+0, 0 
	XORLW       18
	BTFSC       STATUS+0, 2 
	GOTO        L_main20
	MOVF        _THREAD_counts+0, 0 
	XORLW       21
	BTFSC       STATUS+0, 2 
	GOTO        L_main21
L_main6:
;tric.c,229 :: 		THREAD_ready = 0;
	CLRF        _THREAD_ready+0 
;tric.c,230 :: 		}
L_main4:
;tric.c,231 :: 		}
	GOTO        L_main2
;tric.c,232 :: 		}
	GOTO        $+0
; end of _main

_interrupt:

;tric.c,234 :: 		void interrupt() {
;tric.c,237 :: 		if(PIR1.TMR1IF) {
	BTFSS       PIR1+0, 0 
	GOTO        L_interrupt22
;tric.c,238 :: 		TMR1H = 0xD1;
	MOVLW       209
	MOVWF       TMR1H+0 
;tric.c,239 :: 		TMR1L = 0x80;
	MOVLW       128
	MOVWF       TMR1L+0 
;tric.c,240 :: 		PIR1.TMR1IF = 0;
	BCF         PIR1+0, 0 
;tric.c,241 :: 		THREAD_counts++;
	INCF        _THREAD_counts+0, 1 
;tric.c,242 :: 		THREAD_ready = 1;
	MOVLW       1
	MOVWF       _THREAD_ready+0 
;tric.c,243 :: 		}
L_interrupt22:
;tric.c,258 :: 		}
L__interrupt23:
	RETFIE      1
; end of _interrupt
